Relatório de Análise de Séries Temporais

## 
## Attaching package: 'zoo'
## 
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## 
## This is forecast 5.6 
## 
## locfit 1.5-9.1    2013-03-22
## Loading required package: nlme
## 
## Attaching package: 'nlme'
## 
## The following object is masked from 'package:forecast':
## 
##     getResponse
## 
## This is mgcv 1.8-3. For overview type 'help("mgcv-package")'.

Este relatório tem como objecto de análise

Dados originais:

##        Jan   Feb   Mar   Apr   May   Jun   Jul   Aug   Sep   Oct   Nov
## 1956  1709  1646  1794  1878  2173  2321  2468  2416  2184  2121  1962
## 1957  1751  1688  1920  1941  2311  2279  2638  2448  2279  2163  1941
## 1958  1773  1688  1783  1984  2290  2511  2712  2522  2342  2195  1931
## 1959  1730  1688  1899  1994  2342  2553  2712  2627  2363  2311  2026
## 1960  1762  1815  2005  2089  2617  2828  2965  2891  2532  2363  2216
## 1961  1804  1773  2015  2089  2627  2712  3007  2880  2490  2237  2205
## 1962  1868  1815  2047  2142  2743  2775  3028  2965  2501  2501  2131
## 1963  1910  1868  2121  2268  2690  2933  3218  3028  2659  2406  2258
## 1964  1889  1984  2110  2311  2785  3039  3229  3070  2659  2543  2237
## 1965  1962  1910  2216  2437  2817  3123  3345  3112  2659  2469  2332
## 1966  1910  1941  2216  2342  2923  3229  3513  3355  2849  2680  2395
## 1967  1994  1952  2290  2395  2965  3239  3608  3524  3018  2648  2363
## 1968  1994  1941  2258  2332  3323  3608  3957  3672  3155  2933  2585
## 1969  2057  2100  2458  2638  3292  3724  4652  4379  4231  3756  3429
## 1970  3345  4220  4874  5064  5951  6774  7997  7523  7438  6879  6489
## 1971  5919  6183  6594  6489  8040  9715  9714  9756  8595  7861  7753
## 1972  7778  7402  8903  9742 11372 12741 13733 13691 12239 12502 11241
## 1973 11569 10397 12493 11962 13974 14945 16805 16587 14225 14157 13016
## 1974 11704 12275 13695 14082 16555 17339 17777 17592 16194 15336 14208
## 1975 12354 12682 14141 14989 16159 18276 19157 18737 17109 17094 15418
## 1976 13260 14990 15975 16770 19819 20983 22001 22337 20750 19969 17293
## 1977 15117 16058 18137 18471 21398 23854 26025 25479 22804 19619 19627
## 1978 17243 18284 20226 20903 23768 26323 28038 26776 22886 22813 22404
## 1979 18839 18892 20823 22212 25076 26884 30611 30228 26762 25885 23328
## 1980 21433 22369 24503 25905 30605 34984 37060 34502 31793 29275 28305
## 1981 27730 27424 32684 31366 37459 41060 43558 42398 33827 34962 33480
## 1982 30715 30400 31451 31306 40592 44133 47387 41310 37913 34355 34607
## 1983 26138 30745 35018 34549 40980 42869 45022 40387 38180 38608 35308
## 1984 28801 33034 35294 33181 40797 42355 46098 42430 41851 39331 37328
## 1985 32494 33308 36805 34221 41020 44350 46173 44435 40943 39269 35901
## 1986 31239 32261 34951 38109 43168 45547 49568 45387 41805 41281 36068
## 1987 32791 34206 39128 40249 43519 46137 56709 52306 49397 45500 39857
## 1988 35567 37696 42319 39137 47062 50610 54457 54435 48516 43225 42155
## 1989 37541 37277 41778 41666 49616 57793 61884 62400 50820 51116 45731
## 1990 40459 40295 44147 42697 52561 56572 56858 58363 45627 45622 41304
## 1991 35592 35677 39864 41761 50380 49129 55066 55671 49058 44503 42145
## 1992 38963 38690 39792 42545 50145 58164 59035 59408 55988 47321 42269
## 1993 37059 37963 31043 41712 50366 56977 56807 54634 51367 48073 46251
## 1994 39975 40478 46895 46147 55011 57799 62450 63896 57784 53231 50354
## 1995 41600 41471 46287 49013 56624 61739 66600 60054                  
##        Dec
## 1956  1825
## 1957  1878
## 1958  1910
## 1959  1910
## 1960  2026
## 1961  1984
## 1962  2015
## 1963  2057
## 1964  2142
## 1965  2110
## 1966  2205
## 1967  2247
## 1968  2384
## 1969  3461
## 1970  6288
## 1971  8154
## 1972 10829
## 1973 12253
## 1974 13116
## 1975 14312
## 1976 16498
## 1977 18488
## 1978 19795
## 1979 21930
## 1980 25248
## 1981 32445
## 1982 28729
## 1983 30234
## 1984 34514
## 1985 32142
## 1986 34879
## 1987 37958
## 1988 39995
## 1989 42528
## 1990 36016
## 1991 38698
## 1992 39606
## 1993 43736
## 1994 38410
## 1995

plot of chunk unnamed-chunk-4

## Warning: p-value smaller than printed p-value
## Warning: p-value smaller than printed p-value
## Warning: p-value smaller than printed p-value
## Warning: p-value smaller than printed p-value

plot of chunk unnamed-chunk-5

Análise de Sazonalidade

plot of chunk unnamed-chunk-6

plot of chunk unnamed-chunk-7

Sazonalidade - Autocorrelações

plot of chunk unnamed-chunk-8

Seasonal Decomposition of Time Series by Loess

plot of chunk unnamed-chunk-10

Outros testes

McLeod-Li test for conditional heteroscedascity (ARCH)

plot of chunk unnamed-chunk-11

Projeções

Space-State Model (ETS)

## ETS(M,Md,M) 
## 
## Call:
##  ets(y = d) 
## 
##   Smoothing parameters:
##     alpha = 0.6534 
##     beta  = 0.0282 
##     gamma = 1e-04 
##     phi   = 0.98 
## 
##   Initial states:
##     l = 2085.0093 
##     b = 0.9965 
##     s=0.8476 0.919 1.004 1.072 1.206 1.264
##            1.176 1.093 0.9198 0.8936 0.8085 0.7973
## 
##   sigma:  0.0486
## 
##  AIC AICc  BIC 
## 8991 8992 9062 
## 
## Training set error measures:
##                 ME RMSE   MAE    MPE  MAPE   MASE    ACF1
## Training set 10.56 1454 791.2 0.1444 3.536 0.4582 -0.1029
## 
## Forecast method: ETS(M,Md,M)
## 
## Model Information:
## ETS(M,Md,M) 
## 
## Call:
##  ets(y = d) 
## 
##   Smoothing parameters:
##     alpha = 0.6534 
##     beta  = 0.0282 
##     gamma = 1e-04 
##     phi   = 0.98 
## 
##   Initial states:
##     l = 2085.0093 
##     b = 0.9965 
##     s=0.8476 0.919 1.004 1.072 1.206 1.264
##            1.176 1.093 0.9198 0.8936 0.8085 0.7973
## 
##   sigma:  0.0486
## 
##  AIC AICc  BIC 
## 8991 8992 9062 
## 
## Error measures:
##                 ME RMSE   MAE    MPE  MAPE   MASE    ACF1
## Training set 10.56 1454 791.2 0.1444 3.536 0.4241 -0.1029
## 
## Forecasts:
##          Point Forecast Lo 80  Hi 80 Lo 95  Hi 95
## Sep 1995          54570 51137  57878 49256  59660
## Oct 1995          51150 47349  55056 45314  57023
## Nov 1995          46882 42894  50972 40954  53380
## Dec 1995          43284 39087  47544 37140  50128
## Jan 1996          40760 36422  45294 34342  47917
## Feb 1996          41378 36568  46515 34045  49494
## Mar 1996          45775 40087  51828 37171  55471
## Apr 1996          47167 40710  54053 37507  58303
## May 1996          56089 47815  64670 43979  70183
## Jun 1996          60426 51093  70289 47329  77135
## Jul 1996          64992 54329  76487 49810  83908
## Aug 1996          62055 51451  73892 46707  81565
## Sep 1996          55226 45372  66325 40804  74255
## Oct 1996          51753 42195  62425 37902  69898
## Nov 1996          47424 38220  57847 34245  64722
## Dec 1996          43774 34913  54193 30991  60944
## Jan 1997          41212 32500  51249 28656  58211
## Feb 1997          41827 32605  52446 28595  59800
## Mar 1997          46263 35796  58630 31316  67271
## Apr 1997          47659 36690  61041 31857  70797
## May 1997          56663 42965  72758 37049  84628
## Jun 1997          61032 45728  79314 39068  93416
## Jul 1997          65630 48831  85912 41708 101327
## Aug 1997          62652 45978  82976 39205  97444
## Sep 1997          55747 40502  74584 34359  88741
## Oct 1997          52232 37598  70399 31669  83769
## Nov 1997          47853 34132  65100 28402  77776
## Dec 1997          44163 31169  60643 26054  72734
## Jan 1998          41571 29133  57514 23942  69832
## Feb 1998          42184 29200  58911 24022  71336
## Mar 1998          46649 31985  65625 25948  79938
## Apr 1998          48049 32716  68266 26541  83150
## May 1998          57117 38359  81873 31053 100488
## Jun 1998          61511 40801  89073 32780 111315
## Jul 1998          66135 43719  96478 34858 121885
## Aug 1998          63125 41010  92952 32924 117214
## Sep 1998          56159 36372  83407 28639 104750
## Oct 1998          52610 33532  78594 26581 100785
## Nov 1998          48193 30408  72846 23877  92543
## Dec 1998          44470 27816  67782 21716  87136
## Jan 1999          41854 25932  64425 20192  82708
## Feb 1999          42466 26037  66118 20023  84462
## Mar 1999          46954 28437  73605 21964  95385
## Apr 1999          48358 29159  76553 22560  99166
## May 1999          57476 34310  91106 26256 119301
## Jun 1999          61890 36358  99770 27951 130750
## Jul 1999          66535 38999 107877 29684 142448
## Aug 1999          63499 36808 104178 27890 137450
## Sep 1999          56485 32650  93215 24438 123808
## Oct 1999          52909 30180  88217 22831 117597
## Nov 1999          48461 27432  81644 20371 110571
## Dec 1999          44713 25115  76383 18614 103450

plot of chunk unnamed-chunk-12

plot of chunk unnamed-chunk-13

Arima - Pr? an?lise

Arima - Autocorrelation

plot of chunk unnamed-chunk-14

Arima - Partial Autocorrelation

plot of chunk unnamed-chunk-15

Arima - Proje??o

## 
##  ARIMA(2,1,2)(1,0,1)[12] with drift         : Inf
##  ARIMA(0,1,0) with drift         : 8882
##  ARIMA(1,1,0)(1,0,0)[12] with drift         : 8506
##  ARIMA(0,1,1)(0,0,1)[12] with drift         : 8695
##  ARIMA(1,1,0) with drift         : 8841
##  ARIMA(1,1,0)(2,0,0)[12] with drift         : 8456
##  ARIMA(1,1,0)(2,0,1)[12] with drift         : Inf
##  ARIMA(0,1,0)(2,0,0)[12] with drift         : 8523
##  ARIMA(2,1,0)(2,0,0)[12] with drift         : 8450
##  ARIMA(2,1,1)(2,0,0)[12] with drift         : 8422
##  ARIMA(3,1,2)(2,0,0)[12] with drift         : Inf
##  ARIMA(2,1,1)(2,0,0)[12]                    : 8420
##  ARIMA(2,1,1)(1,0,0)[12]                    : 8467
##  ARIMA(2,1,1)(2,0,1)[12]                    : Inf
##  ARIMA(1,1,1)(2,0,0)[12]                    : Inf
##  ARIMA(3,1,1)(2,0,0)[12]                    : Inf
##  ARIMA(2,1,0)(2,0,0)[12]                    : 8448
##  ARIMA(2,1,2)(2,0,0)[12]                    : 8421
##  ARIMA(1,1,0)(2,0,0)[12]                    : 8454
##  ARIMA(3,1,2)(2,0,0)[12]                    : Inf
## 
##  Best model: ARIMA(2,1,1)(2,0,0)[12]
## 
## Forecast method: ARIMA(2,1,1)(2,0,0)[12]                   
## 
## Model Information:
## Series: d 
## ARIMA(2,1,1)(2,0,0)[12]                    
## 
## Coefficients:
##         ar1    ar2     ma1   sar1   sar2
##       0.472  0.219  -0.956  0.554  0.352
## s.e.  0.061  0.058   0.035  0.046  0.046
## 
## sigma^2 estimated as 2807497:  log likelihood=-4210
## AIC=8431   AICc=8432   BIC=8456
## 
## Error measures:
##                 ME RMSE   MAE    MPE  MAPE  MASE     ACF1
## Training set 100.8 1674 955.2 0.7066 4.236 0.512 -0.01898
## 
## Forecasts:
##          Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
## Sep 1995          57436 55288 59583 54152 60720
## Oct 1995          53216 50801 55632 49522 56911
## Nov 1995          51148 48499 53796 47097 55198
## Dec 1995          43604 40823 46385 39351 47857
## Jan 1996          44065 41190 46941 39668 48463
## Feb 1996          44172 41229 47114 39671 48672
## Mar 1996          49107 46114 52100 44529 53685
## Apr 1996          50357 47324 53389 45718 54995
## May 1996          57701 54636 60766 53013 62389
## Jun 1996          61520 58427 64613 56790 66250
## Jul 1996          65855 62738 68971 61088 70621
## Aug 1996          62737 59599 65875 57938 67536
## Sep 1996          59132 55637 62628 53786 64479
## Oct 1996          55190 51567 58813 49649 60731
## Nov 1996          53029 49288 56771 47308 58751
## Dec 1996          44639 40814 48463 38790 50488
## Jan 1997          46019 42127 49912 40066 51972
## Feb 1997          46033 42085 49981 39995 52071
## Mar 1997          50466 46470 54462 44354 56577
## Apr 1997          52119 48081 56157 45943 58295
## May 1997          58872 54796 62949 52639 65106
## Jun 1997          62792 58681 66903 56505 69079
## Jul 1997          66908 62764 71051 60570 73245
## Aug 1997          62873 58698 67047 56488 69257
## Sep 1997          59952 55359 64545 52927 66977
## Oct 1997          56280 51526 61033 49010 63549
## Nov 1997          54353 49450 59257 46854 61852
## Dec 1997          47044 42031 52057 39377 54711
## Jan 1998          47972 42867 53076 40165 55779
## Feb 1998          48017 42835 53199 40092 55942
## Mar 1998          52213 46964 57462 44185 60241
## Apr 1998          53570 48260 58880 45450 61690
## May 1998          59901 54537 65266 51697 68106
## Jun 1998          63420 58004 68836 55136 71703
## Jul 1998          67229 61764 72694 58871 75587
## Aug 1998          63894 58382 69405 55465 72322
## Sep 1998          61004 55172 66837 52085 69924
## Oct 1998          57579 51600 63558 48435 66724
## Nov 1998          55750 49632 61869 46393 65108
## Dec 1998          48742 42514 54970 39217 58267
## Jan 1999          49742 43420 56065 40072 59413
## Feb 1999          49772 43366 56179 39975 59570
## Mar 1999          53661 47179 60142 43748 63573
## Apr 1999          54995 48444 61546 44976 65014
## May 1999          60885 54269 67501 50767 71003
## Jun 1999          64216 57539 70894 54004 74429
## Jul 1999          67778 61041 74514 57475 78080
## Aug 1999          64507 57714 71301 54117 74897
## Sep 1999          61876 54784 68968 51030 72723
## Oct 1999          58684 51442 65925 47609 69759
## Nov 1999          56991 49606 64376 45697 68285
## Dec 1999          50531 43030 58032 39059 62002

plot of chunk unnamed-chunk-16

Linear Model

plot of chunk unnamed-chunk-17

## 
## Call:
## lm(formula = d ~ time(d))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -16988  -5263  -1184   4830  19858 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -3.01e+06   5.04e+04   -59.6   <2e-16 ***
## time(d)      1.53e+03   2.55e+01    60.0   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6380 on 474 degrees of freedom
## Multiple R-squared:  0.884,  Adjusted R-squared:  0.883 
## F-statistic: 3.6e+03 on 1 and 474 DF,  p-value: <2e-16

plot of chunk unnamed-chunk-19

## Analysis of Variance Table
## 
## Response: d
##            Df   Sum Sq  Mean Sq F value Pr(>F)    
## time(d)     1 1.46e+11 1.46e+11    3603 <2e-16 ***
## Residuals 474 1.93e+10 4.06e+07                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Trend - Seazonal Linear Model

plot of chunk unnamed-chunk-21

## 
## Call:
## lm(formula = formula, data = "d", na.action = na.exclude)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -14888  -4144   -586   3949  15668 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -12909.11     994.61  -12.98  < 2e-16 ***
## trend          127.42       1.88   67.77  < 2e-16 ***
## season2        351.28    1260.19    0.28    0.781    
## season3       1885.52    1260.19    1.50    0.135    
## season4       2211.50    1260.20    1.75    0.080 .  
## season5       5704.76    1260.21    4.53  7.6e-06 ***
## season6       7552.62    1260.22    5.99  4.1e-09 ***
## season7       9243.11    1260.24    7.33  1.0e-12 ***
## season8       8164.92    1260.26    6.48  2.4e-10 ***
## season9       5321.77    1268.25    4.20  3.3e-05 ***
## season10      3946.18    1268.25    3.11    0.002 ** 
## season11      2299.22    1268.26    1.81    0.070 .  
## season12       456.53    1268.28    0.36    0.719    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5640 on 463 degrees of freedom
## Multiple R-squared:  0.911,  Adjusted R-squared:  0.909 
## F-statistic:  396 on 12 and 463 DF,  p-value: <2e-16
## Analysis of Variance Table
## 
## Response: d
##            Df   Sum Sq  Mean Sq F value Pr(>F)    
## trend       1 1.46e+11 1.46e+11  4610.9 <2e-16 ***
## season     11 4.56e+09 4.15e+08    13.1 <2e-16 ***
## Residuals 463 1.47e+10 3.18e+07                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

plot of chunk unnamed-chunk-24

Compara??o de Modelos

plot of chunk unnamed-chunk-25

Erros

plot of chunk unnamed-chunk-26

Residuos ETS

plot of chunk unnamed-chunk-27

Residuos ARIMA

plot of chunk unnamed-chunk-28

Residuos TSLM

plot of chunk unnamed-chunk-29